#ifndef LOGGER_H
#define LOGGER_H

#include <string>
#include <ctime>
#include <fstream>
#include "boost/filesystem.hpp"

class Logger {
public:
	static int Initialize(short logLevel, std::string logFile = "Default.log");
	static int Shutdown();
	static void Log(int errorCode, std::string message, std::string file, int line, short errorType);
	static void Log(std::string message, std::string file, int line); // For Notices only!
	static void SetLogfile(std::string file);
	
private:
	static FILE* logFile;
	static std::string logFileName;
	static std::string filepath;
	static std::string archive;
	static time_t logtime;
	static tm* now;
	static int maxlines;
	static short logLevel;

	static void WriteLog(std::string message);
	static void CheckLogFileSize();
	static void RotateLogFiles();
};

#define LOG_ERROR 1
#define LOG_WARNING 2
#define LOG_NOTICE 3
#define LOG_NOTHING 0
#define LOG_ERRORS 1
#define LOG_WARNINGS 2
#define LOG_NOTICES 3

#endif